import {baseURL} from "./config.js"
export default function(params) {
  return new Promise((resolve,reject)=> {
    uni.showLoading({
      title: "加载中"
    });
    wx.request({
      ...params,
      url: baseURL+params.url,
      success(res) {
        resolve(res.data)
      },
      fail(err) {
        reject(err)
      },
      complete() {
        uni.hideLoading()
      }
    })
  })
}